package cn.madis.ymcc.fallback;




import cn.madis.ymcc.MediaFeignClient;

import cn.madis.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class MediaFeignClientFallbackFactory implements FallbackFactory<MediaFeignClient> {


    @Override
    public MediaFeignClient create(Throwable throwable) {
        return new MediaFeignClient() {
            @Override
            public JSONResult getMedia(Long courseId) {
                throwable.printStackTrace();
                return JSONResult.error("降级gggg");
            }
        };
    }
}
